home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / bbsutil / dlx70bbs.zip / DLX70SRC.ZIP / RNTABS.C < prev    next >
C/C++ Source or Header  |  1994-01-19  |  1KB  |  74 lines

  1. /*
  2.  RNTABS.C:
  3.  Make a generic tab-delimited table out of a DLX REALNAME file
  4.  This table can then be read by a spreadsheet or Works or what have you
  5.  
  6.  DLX Bulletin Board System V7.0
  7.  
  8.  FREEWARE NOTICE
  9.  
  10.  DLX V7.0 is placed in the public domain by its author, Richard Gillmann.
  11.  Anyone who wishes to may run the program, copy it, or modify it for
  12.  any purpose, including commercial gain.
  13.  
  14. */       
  15.  
  16. #include <stdio.h>
  17. #include <string.h>
  18.  
  19. FILE *fp;
  20.  
  21. char szLines[81];
  22. char szFrom[81],szTo[81],szDate[81],szSubject[81];
  23. char szNada[81];
  24. char szName[81],szAddress[81],szCity[81],szPhone[81];
  25.  
  26. char szBig[400];
  27.  
  28. MyGets(char *sz)
  29. {
  30.     fgets(sz,81,fp);
  31.     sz[strlen(sz)-1]='\0';
  32. }
  33.  
  34. main()
  35. {
  36.  
  37.     int n,nFile,max,nLen;
  38.  
  39.     if(!(fp = fopen("realname","r")))
  40.     return 1;
  41.  
  42.     while (!feof(fp))
  43.     {
  44.     MyGets(szLines);
  45.     if (atoi(szLines)!=9) continue;
  46.     
  47.     fscanf(fp,"From: ");
  48.     MyGets(szFrom);
  49.     nFile = atoi(strrchr(szFrom,' ')+1);
  50.     if (!nFile) continue;
  51.     *strrchr(szFrom,' ')='\0';
  52.  
  53.     MyGets(szTo);
  54.     fscanf(fp,"Date: ");
  55.     MyGets(szDate);
  56.     *strrchr(szDate,' ')='\0';
  57.  
  58.     fscanf(fp,"Subject: New Caller/");
  59.     MyGets(szSubject);
  60.  
  61.     MyGets(szNada);
  62.     MyGets(szName);
  63.     MyGets(szAddress);
  64.     MyGets(szCity);
  65.     MyGets(szPhone);
  66.  
  67.     printf("%s\t%d\t%s\t%s\t%s\t%s\t%s\t%s\tNEW\n",
  68.           szFrom,nFile,szDate,szName,szAddress,szCity,szPhone,szSubject);
  69.     }
  70.  
  71.     fclose(fp);
  72.     return 0;
  73. }
  74.